home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / TEMP / GNU / flex / Options < prev    next >
Text File  |  1995-06-28  |  21KB  |  634 lines

  1. Options
  2. Previous: <YACC interface=>YACCinterf> * Next: <Performance=>Performanc> * Up: <Top=>!Root>
  3.  
  4. #Wrap on
  5. {fH3}Options{f}
  6. {fCode}flex{f} has the following options:
  7.  
  8. #Indent +4
  9. #Indent
  10. {fEmphasis}-b{f}
  11. #Indent +4
  12. Generate backing-up information to {fCite}lex.backup{f}.
  13. This is a list of scanner states which require
  14. backing up and the input characters on which they
  15. do so.  By adding rules one can remove backing-up
  16. states.  If {fEmphasis}all{f} backing-up states are eliminated
  17. and {fEmphasis}-Cf{f} or {fEmphasis}-CF{f} is used, the generated scanner will
  18. run faster (see the {fEmphasis}-p{f} flag).  Only users who wish
  19. to squeeze every last cycle out of their scanners
  20. need worry about this option.  (See the section on
  21. Performance Considerations below.)
  22.  
  23. #Indent
  24. {fEmphasis}-c{f}
  25. #Indent +4
  26. is a do-nothing, deprecated option included for
  27. POSIX compliance.
  28.  
  29. #Indent
  30. {fEmphasis}-d{f}
  31. #Indent +4
  32. makes the generated scanner run in {fUnderline}debug{f} mode.
  33. Whenever a pattern is recognized and the global
  34. {fCode}yy\_flex\_debug{f} is non-zero (which is the default),
  35. the scanner will write to {fCode}stderr{f} a line of the
  36. form:
  37.  
  38. #Wrap off
  39. #fCode
  40. --accepting rule at line 53 ("the matched text")
  41. #f
  42. #Wrap on
  43.  
  44. The line number refers to the location of the rule
  45. in the file defining the scanner (i.e., the file
  46. that was fed to flex).  Messages are also generated
  47. when the scanner backs up, accepts the default
  48. rule, reaches the end of its input buffer (or
  49. encounters a NUL; at this point, the two look the
  50. same as far as the scanner's concerned), or reaches
  51. an end-of-file.
  52.  
  53. #Indent
  54. {fEmphasis}-f{f}
  55. #Indent +4
  56. specifies {fUnderline}fast scanner{f}.  No table compression is
  57. done and stdio is bypassed.  The result is large
  58. but fast.  This option is equivalent to {fEmphasis}-Cfr{f} (see
  59. below).
  60.  
  61. #Indent
  62. {fEmphasis}-h{f}
  63. #Indent +4
  64. generates a "help" summary of {fCode}flex's{f} options to
  65. {fCode}stdout{f} and then exits.  {fEmphasis}-?{f} and {fEmphasis}--help{f} are synonyms
  66. for {fEmphasis}-h{f}.
  67.  
  68. #Indent
  69. {fEmphasis}-i{f}
  70. #Indent +4
  71. instructs {fCode}flex{f} to generate a {fEmphasis}case-insensitive{f}
  72. scanner.  The case of letters given in the {fCode}flex{f} input
  73. patterns will be ignored, and tokens in the input
  74. will be matched regardless of case.  The matched
  75. text given in {fCode}yytext{f} will have the preserved case
  76. (i.e., it will not be folded).
  77.  
  78. #Indent
  79. {fEmphasis}-l{f}
  80. #Indent +4
  81. turns on maximum compatibility with the original
  82. AT&T {fCode}lex{f} implementation.  Note that this does not
  83. mean {fEmphasis}full{f} compatibility.  Use of this option costs
  84. a considerable amount of performance, and it cannot
  85. be used with the {fEmphasis}-+, -f, -F, -Cf{f}, or {fEmphasis}-CF{f} options.
  86. For details on the compatibilities it provides, see
  87. the section "Incompatibilities With Lex And POSIX"
  88. below.  This option also results in the name
  89. {fCode}YY\_FLEX\_LEX\_COMPAT{f} being \#define'd in the generated
  90. scanner.
  91.  
  92. #Indent
  93. {fEmphasis}-n{f}
  94. #Indent +4
  95. is another do-nothing, deprecated option included
  96. only for POSIX compliance.
  97.  
  98. #Indent
  99. {fEmphasis}-p{f}
  100. #Indent +4
  101. generates a performance report to stderr.  The
  102. report consists of comments regarding features of
  103. the {fCode}flex{f} input file which will cause a serious loss
  104. of performance in the resulting scanner.  If you
  105. give the flag twice, you will also get comments
  106. regarding features that lead to minor performance
  107. losses.
  108.  
  109. Note that the use of {fCode}REJECT{f}, {fEmphasis}%option yylineno{f} and
  110. variable trailing context (see the Deficiencies \/ Bugs section below)
  111. entails a substantial performance penalty; use of {fEmphasis}yymore(){f},
  112. the {fEmphasis}^{f} operator, and the {fEmphasis}-I{f} flag entail minor performance
  113. penalties.
  114.  
  115. #Indent
  116. {fEmphasis}-s{f}
  117. #Indent +4
  118. causes the {fUnderline}default rule{f} (that unmatched scanner
  119. input is echoed to {fCode}stdout{f}) to be suppressed.  If
  120. the scanner encounters input that does not match
  121. any of its rules, it aborts with an error.  This
  122. option is useful for finding holes in a scanner's
  123. rule set.
  124.  
  125. #Indent
  126. {fEmphasis}-t{f}
  127. #Indent +4
  128. instructs {fCode}flex{f} to write the scanner it generates to
  129. standard output instead of {fCite}lex.yy.c{f}.
  130.  
  131. #Indent
  132. {fEmphasis}-v{f}
  133. #Indent +4
  134. specifies that {fCode}flex{f} should write to {fCode}stderr{f} a
  135. summary of statistics regarding the scanner it
  136. generates.  Most of the statistics are meaningless to
  137. the casual {fCode}flex{f} user, but the first line identifies
  138. the version of {fCode}flex{f} (same as reported by {fEmphasis}-V{f}), and
  139. the next line the flags used when generating the
  140. scanner, including those that are on by default.
  141.  
  142. #Indent
  143. {fEmphasis}-w{f}
  144. #Indent +4
  145. suppresses warning messages.
  146.  
  147. #Indent
  148. {fEmphasis}-B{f}
  149. #Indent +4
  150. instructs {fCode}flex{f} to generate a {fEmphasis}batch{f} scanner, the
  151. opposite of {fEmphasis}interactive{f} scanners generated by {fEmphasis}-I{f}
  152. (see below).  In general, you use {fEmphasis}-B{f} when you are
  153. {fEmphasis}certain{f} that your scanner will never be used
  154. interactively, and you want to squeeze a {fEmphasis}little{f} more
  155. performance out of it.  If your goal is instead to
  156. squeeze out a {fEmphasis}lot{f} more performance, you should be
  157. using the {fEmphasis}-Cf{f} or {fEmphasis}-CF{f} options (discussed below),
  158. which turn on {fEmphasis}-B{f} automatically anyway.
  159.  
  160. #Indent
  161. {fEmphasis}-F{f}
  162. #Indent +4
  163. specifies that the {fUnderline}fast{f} scanner table
  164. representation should be used (and stdio bypassed).  This
  165. representation is about as fast as the full table
  166. representation {fEmphasis}(-f){f}, and for some sets of patterns
  167. will be considerably smaller (and for others,
  168. larger).  In general, if the pattern set contains
  169. both "keywords" and a catch-all, "identifier" rule,
  170. such as in the set:
  171.  
  172. #Wrap off
  173. #fCode
  174. "case"    return TOK\_CASE;
  175. "switch"  return TOK\_SWITCH;
  176. ...
  177. "default" return TOK\_DEFAULT;
  178. [a-z]+    return TOK\_ID;
  179. #f
  180. #Wrap on
  181.  
  182. then you're better off using the full table
  183. representation.  If only the "identifier" rule is
  184. present and you then use a hash table or some such to
  185. detect the keywords, you're better off using {fEmphasis}-F{f}.
  186.  
  187. This option is equivalent to {fEmphasis}-CFr{f} (see below).  It
  188. cannot be used with {fEmphasis}-+{f}.
  189.  
  190. #Indent
  191. {fEmphasis}-I{f}
  192. #Indent +4
  193. instructs {fCode}flex{f} to generate an {fEmphasis}interactive{f} scanner.
  194. An interactive scanner is one that only looks ahead
  195. to decide what token has been matched if it
  196. absolutely must.  It turns out that always looking one
  197. extra character ahead, even if the scanner has
  198. already seen enough text to disambiguate the
  199. current token, is a bit faster than only looking ahead
  200. when necessary.  But scanners that always look
  201. ahead give dreadful interactive performance; for
  202. example, when a user types a newline, it is not
  203. recognized as a newline token until they enter
  204. {fEmphasis}another{f} token, which often means typing in another
  205. whole line.
  206.  
  207. {fCode}Flex{f} scanners default to {fEmphasis}interactive{f} unless you use
  208. the {fEmphasis}-Cf{f} or {fEmphasis}-CF{f} table-compression options (see
  209. below).  That's because if you're looking for
  210. high-performance you should be using one of these
  211. options, so if you didn't, {fCode}flex{f} assumes you'd
  212. rather trade off a bit of run-time performance for
  213. intuitive interactive behavior.  Note also that you
  214. {fEmphasis}cannot{f} use {fEmphasis}-I{f} in conjunction with {fEmphasis}-Cf{f} or {fEmphasis}-CF{f}.
  215. Thus, this option is not really needed; it is on by
  216. default for all those cases in which it is allowed.
  217.  
  218. You can force a scanner to {fEmphasis}not{f} be interactive by
  219. using {fEmphasis}-B{f} (see above).
  220.  
  221. #Indent
  222. {fEmphasis}-L{f}
  223. #Indent +4
  224. instructs {fCode}flex{f} not to generate {fEmphasis}\#line{f} directives.
  225. Without this option, {fCode}flex{f} peppers the generated
  226. scanner with \#line directives so error messages in
  227. the actions will be correctly located with respect
  228. to either the original {fCode}flex{f} input file (if the
  229. errors are due to code in the input file), or
  230. {fCite}lex.yy.c{f} (if the errors are {fCode}flex's{f} fault -- you
  231. should report these sorts of errors to the email
  232. address given below).
  233.  
  234. #Indent
  235. {fEmphasis}-T{f}
  236. #Indent +4
  237. makes {fCode}flex{f} run in {fCode}trace{f} mode.  It will generate a
  238. lot of messages to {fCode}stderr{f} concerning the form of
  239. the input and the resultant non-deterministic and
  240. deterministic finite automata.  This option is
  241. mostly for use in maintaining {fCode}flex{f}.
  242.  
  243. #Indent
  244. {fEmphasis}-V{f}
  245. #Indent +4
  246. prints the version number to {fCode}stdout{f} and exits.
  247. {fEmphasis}--version{f} is a synonym for {fEmphasis}-V{f}.
  248.  
  249. #Indent
  250. {fEmphasis}-7{f}
  251. #Indent +4
  252. instructs {fCode}flex{f} to generate a 7-bit scanner, i.e.,
  253. one which can only recognized 7-bit characters in
  254. its input.  The advantage of using {fEmphasis}-7{f} is that the
  255. scanner's tables can be up to half the size of
  256. those generated using the {fEmphasis}-8{f} option (see below).
  257. The disadvantage is that such scanners often hang
  258. or crash if their input contains an 8-bit
  259. character.
  260.  
  261. Note, however, that unless you generate your
  262. scanner using the {fEmphasis}-Cf{f} or {fEmphasis}-CF{f} table compression options,
  263. use of {fEmphasis}-7{f} will save only a small amount of table
  264. space, and make your scanner considerably less
  265. portable.  {fCode}Flex's{f} default behavior is to generate
  266. an 8-bit scanner unless you use the {fEmphasis}-Cf{f} or {fEmphasis}-CF{f}, in
  267. which case {fCode}flex{f} defaults to generating 7-bit
  268. scanners unless your site was always configured to
  269. generate 8-bit scanners (as will often be the case
  270. with non-USA sites).  You can tell whether flex
  271. generated a 7-bit or an 8-bit scanner by inspecting
  272. the flag summary in the {fEmphasis}-v{f} output as described
  273. above.
  274.  
  275. Note that if you use {fEmphasis}-Cfe{f} or {fEmphasis}-CFe{f} (those table
  276. compression options, but also using equivalence
  277. classes as discussed see below), flex still
  278. defaults to generating an 8-bit scanner, since
  279. usually with these compression options full 8-bit
  280. tables are not much more expensive than 7-bit
  281. tables.
  282.  
  283. #Indent
  284. {fEmphasis}-8{f}
  285. #Indent +4
  286. instructs {fCode}flex{f} to generate an 8-bit scanner, i.e.,
  287. one which can recognize 8-bit characters.  This
  288. flag is only needed for scanners generated using
  289. {fEmphasis}-Cf{f} or {fEmphasis}-CF{f}, as otherwise flex defaults to
  290. generating an 8-bit scanner anyway.
  291.  
  292. See the discussion of {fEmphasis}-7{f} above for flex's default
  293. behavior and the tradeoffs between 7-bit and 8-bit
  294. scanners.
  295.  
  296. #Indent
  297. {fEmphasis}-+{f}
  298. #Indent +4
  299. specifies that you want flex to generate a C++
  300. scanner class.  See the section on Generating C++
  301. Scanners below for details.
  302.  
  303. #Indent
  304. {fEmphasis}-C[aefFmr]{f}
  305. #Indent +4
  306. controls the degree of table compression and, more
  307. generally, trade-offs between small scanners and
  308. fast scanners.
  309.  
  310. {fEmphasis}-Ca{f} ("align") instructs flex to trade off larger
  311. tables in the generated scanner for faster
  312. performance because the elements of the tables are better
  313. aligned for memory access and computation.  On some
  314. RISC architectures, fetching and manipulating
  315. long-words is more efficient than with smaller-sized
  316. units such as shortwords.  This option can double
  317. the size of the tables used by your scanner.
  318.  
  319. {fEmphasis}-Ce{f} directs {fCode}flex{f} to construct {fUnderline}equivalence classes{f},
  320. i.e., sets of characters which have identical
  321. lexical properties (for example, if the only appearance
  322. of digits in the {fCode}flex{f} input is in the character
  323. class "[0-9]" then the digits '0', '1', …, '9'
  324. will all be put in the same equivalence class).
  325. Equivalence classes usually give dramatic
  326. reductions in the final table\/object file sizes
  327. (typically a factor of 2-5) and are pretty cheap
  328. performance-wise (one array look-up per character
  329. scanned).
  330.  
  331. {fEmphasis}-Cf{f} specifies that the {fEmphasis}full{f} scanner tables should
  332. be generated - {fCode}flex{f} should not compress the tables
  333. by taking advantages of similar transition
  334. functions for different states.
  335.  
  336. {fEmphasis}-CF{f} specifies that the alternate fast scanner
  337. representation (described above under the {fEmphasis}-F{f} flag)
  338. should be used.  This option cannot be used with
  339. {fEmphasis}-+{f}.
  340.  
  341. {fEmphasis}-Cm{f} directs {fCode}flex{f} to construct {fUnderline}meta-equivalence
  342. classes{f}, which are sets of equivalence classes (or
  343. characters, if equivalence classes are not being
  344. used) that are commonly used together.
  345. Meta-equivalence classes are often a big win when using
  346. compressed tables, but they have a moderate
  347. performance impact (one or two "if" tests and one array
  348. look-up per character scanned).
  349.  
  350. {fEmphasis}-Cr{f} causes the generated scanner to {fEmphasis}bypass{f} use of
  351. the standard I\/O library (stdio) for input.
  352. Instead of calling {fEmphasis}fread(){f} or {fEmphasis}getc(){f}, the scanner
  353. will use the {fEmphasis}read(){f} system call, resulting in a
  354. performance gain which varies from system to
  355. system, but in general is probably negligible unless
  356. you are also using {fEmphasis}-Cf{f} or {fEmphasis}-CF{f}.  Using {fEmphasis}-Cr{f} can cause
  357. strange behavior if, for example, you read from
  358. {fCode}yyin{f} using stdio prior to calling the scanner
  359. (because the scanner will miss whatever text your
  360. previous reads left in the stdio input buffer).
  361.  
  362. {fEmphasis}-Cr{f} has no effect if you define {fCode}YY\_INPUT{f} (see The
  363. Generated Scanner above).
  364.  
  365. A lone {fEmphasis}-C{f} specifies that the scanner tables should
  366. be compressed but neither equivalence classes nor
  367. meta-equivalence classes should be used.
  368.  
  369. The options {fEmphasis}-Cf{f} or {fEmphasis}-CF{f} and {fEmphasis}-Cm{f} do not make sense
  370. together - there is no opportunity for
  371. meta-equivalence classes if the table is not being
  372. compressed.  Otherwise the options may be freely
  373. mixed, and are cumulative.
  374.  
  375. The default setting is {fEmphasis}-Cem{f}, which specifies that
  376. {fCode}flex{f} should generate equivalence classes and
  377. meta-equivalence classes.  This setting provides the
  378. highest degree of table compression.  You can trade
  379. off faster-executing scanners at the cost of larger
  380. tables with the following generally being true:
  381.  
  382. #Wrap off
  383. #fCode
  384. slowest & smallest
  385.       -Cem
  386.       -Cm
  387.       -Ce
  388.       -C
  389.       -C\{f,F\}e
  390.       -C\{f,F\}
  391.       -C\{f,F\}a
  392. fastest & largest
  393. #f
  394. #Wrap on
  395.  
  396. Note that scanners with the smallest tables are
  397. usually generated and compiled the quickest, so
  398. during development you will usually want to use the
  399. default, maximal compression.
  400.  
  401. {fEmphasis}-Cfe{f} is often a good compromise between speed and
  402. size for production scanners.
  403.  
  404. #Indent
  405. {fEmphasis}-ooutput{f}
  406. #Indent +4
  407. directs flex to write the scanner to the file {fEmphasis}out-{f}
  408. {fCode}put{f} instead of {fCite}lex.yy.c{f}.  If you combine {fEmphasis}-o{f} with
  409. the {fEmphasis}-t{f} option, then the scanner is written to
  410. {fCode}stdout{f} but its {fEmphasis}\#line{f} directives (see the {fEmphasis}-L{f} option
  411. above) refer to the file {fCode}output{f}.
  412.  
  413. #Indent
  414. {fEmphasis}-Pprefix{f}
  415. #Indent +4
  416. changes the default {fEmphasis}yy{f} prefix used by {fCode}flex{f} for all
  417. globally-visible variable and function names to
  418. instead be {fStrong}prefix{f}.  For example, {fEmphasis}-Pfoo{f} changes the
  419. name of {fCode}yytext{f} to {fCite}footext{f}.  It also changes the
  420. name of the default output file from {fCite}lex.yy.c{f} to
  421. {fCite}lex.foo.c{f}.  Here are all of the names affected:
  422.  
  423. #Wrap off
  424. #fCode
  425. yy\_create\_buffer
  426. yy\_delete\_buffer
  427. yy\_flex\_debug
  428. yy\_init\_buffer
  429. yy\_flush\_buffer
  430. yy\_load\_buffer\_state
  431. yy\_switch\_to\_buffer
  432. yyin
  433. yyleng
  434. yylex
  435. yylineno
  436. yyout
  437. yyrestart
  438. yytext
  439. yywrap
  440. #f
  441. #Wrap on
  442.  
  443. (If you are using a C++ scanner, then only {fCode}yywrap{f}
  444. and {fCode}yyFlexLexer{f} are affected.) Within your scanner
  445. itself, you can still refer to the global variables
  446. and functions using either version of their name;
  447. but externally, they have the modified name.
  448.  
  449. This option lets you easily link together multiple
  450. {fCode}flex{f} programs into the same executable.  Note,
  451. though, that using this option also renames
  452. {fEmphasis}yywrap(){f}, so you now {fEmphasis}must{f} either provide your own
  453. (appropriately-named) version of the routine for
  454. your scanner, or use {fEmphasis}%option noyywrap{f}, as linking
  455. with {fEmphasis}-lfl{f} no longer provides one for you by
  456. default.
  457.  
  458. #Indent
  459. {fEmphasis}-Sskeleton\_file{f}
  460. #Indent +4
  461. overrides the default skeleton file from which {fCode}flex{f}
  462. constructs its scanners.  You'll never need this
  463. option unless you are doing {fCode}flex{f} maintenance or
  464. development.
  465.  
  466. #Indent
  467.  
  468. {fCode}flex{f} also provides a mechanism for controlling options
  469. within the scanner specification itself, rather than from
  470. the flex command-line.  This is done by including {fEmphasis}%option{f}
  471. directives in the first section of the scanner
  472. specification.  You can specify multiple options with a single
  473. {fEmphasis}%option{f} directive, and multiple directives in the first
  474. section of your flex input file.  Most options are given
  475. simply as names, optionally preceded by the word "no"
  476. (with no intervening whitespace) to negate their meaning.
  477. A number are equivalent to flex flags or their negation:
  478.  
  479. #Wrap off
  480. #fCode
  481. 7bit            -7 option
  482. 8bit            -8 option
  483. align           -Ca option
  484. backup          -b option
  485. batch           -B option
  486. c++             -+ option
  487.  
  488. caseful or
  489. case-sensitive  opposite of -i (default)
  490.  
  491. case-insensitive or
  492. caseless        -i option
  493.  
  494. debug           -d option
  495. default         opposite of -s option
  496. ecs             -Ce option
  497. fast            -F option
  498. full            -f option
  499. interactive     -I option
  500. lex-compat      -l option
  501. meta-ecs        -Cm option
  502. perf-report     -p option
  503. read            -Cr option
  504. stdout          -t option
  505. verbose         -v option
  506. warn            opposite of -w option
  507.                 (use "%option nowarn" for -w)
  508.  
  509. array           equivalent to "%array"
  510. pointer         equivalent to "%pointer" (default)
  511. #f
  512. #Wrap on
  513.  
  514. Some {fEmphasis}%option's{f} provide features otherwise not available:
  515.  
  516. #Indent +4
  517. #Indent
  518. {fEmphasis}always-interactive{f}
  519. #Indent +4
  520. instructs flex to generate a scanner which always
  521. considers its input "interactive".  Normally, on
  522. each new input file the scanner calls {fEmphasis}isatty(){f} in
  523. an attempt to determine whether the scanner's input
  524. source is interactive and thus should be read a
  525. character at a time.  When this option is used,
  526. however, then no such call is made.
  527.  
  528. #Indent
  529. {fEmphasis}main{f}
  530. #Indent +4
  531. directs flex to provide a default {fEmphasis}main(){f} program
  532. for the scanner, which simply calls {fEmphasis}yylex(){f}.  This
  533. option implies {fCode}noyywrap{f} (see below).
  534.  
  535. #Indent
  536. {fEmphasis}never-interactive{f}
  537. #Indent +4
  538. instructs flex to generate a scanner which never
  539. considers its input "interactive" (again, no call
  540. made to {fEmphasis}isatty()){f}.  This is the opposite of {fEmphasis}always-{f}
  541. {fEmphasis}interactive{f}.
  542.  
  543. #Indent
  544. {fEmphasis}stack{f}
  545. #Indent +4
  546. enables the use of start condition stacks (see
  547. Start Conditions above).
  548.  
  549. #Indent
  550. {fEmphasis}stdinit{f}
  551. #Indent +4
  552. if unset (i.e., {fEmphasis}%option nostdinit{f}) initializes {fCode}yyin{f}
  553. and {fCode}yyout{f} to nil {fCode}FILE{f} pointers, instead of {fCode}stdin{f}
  554. and {fCode}stdout{f}.
  555.  
  556. #Indent
  557. {fEmphasis}yylineno{f}
  558. #Indent +4
  559. directs {fCode}flex{f} to generate a scanner that maintains the number
  560. of the current line read from its input in the global variable
  561. {fCode}yylineno{f}.  This option is implied by {fEmphasis}%option lex-compat{f}.
  562.  
  563. #Indent
  564. {fEmphasis}yywrap{f}
  565. #Indent +4
  566. if unset (i.e., {fEmphasis}%option noyywrap{f}), makes the
  567. scanner not call {fEmphasis}yywrap(){f} upon an end-of-file, but
  568. simply assume that there are no more files to scan
  569. (until the user points {fCode}yyin{f} at a new file and calls
  570. {fEmphasis}yylex(){f} again).
  571.  
  572. #Indent
  573.  
  574. {fCode}flex{f} scans your rule actions to determine whether you use
  575. the {fCode}REJECT{f} or {fEmphasis}yymore(){f} features.  The {fCode}reject{f} and {fCode}yymore{f}
  576. options are available to override its decision as to
  577. whether you use the options, either by setting them (e.g.,
  578. {fEmphasis}%option reject{f}) to indicate the feature is indeed used, or
  579. unsetting them to indicate it actually is not used (e.g.,
  580. {fEmphasis}%option noyymore{f}).
  581.  
  582. Three options take string-delimited values, offset with '=':
  583.  
  584. #Wrap off
  585. #fCode
  586. %option outfile="ABC"
  587. #f
  588. #Wrap on
  589.  
  590. is equivalent to {fEmphasis}-oABC{f}, and
  591.  
  592. #Wrap off
  593. #fCode
  594. %option prefix="XYZ"
  595. #f
  596. #Wrap on
  597.  
  598. is equivalent to {fEmphasis}-PXYZ{f}.
  599.  
  600. Finally,
  601.  
  602. #Wrap off
  603. #fCode
  604. %option yyclass="foo"
  605. #f
  606. #Wrap on
  607.  
  608. only applies when generating a C++ scanner ({fEmphasis}-+{f} option).  It
  609. informs {fCode}flex{f} that you have derived {fEmphasis}foo{f} as a subclass of
  610. {fCode}yyFlexLexer{f} so {fCode}flex{f} will place your actions in the member
  611. function {fEmphasis}foo::yylex(){f} instead of {fEmphasis}yyFlexLexer::yylex(){f}.
  612. It also generates a {fEmphasis}yyFlexLexer::yylex(){f} member function that
  613. emits a run-time error (by invoking {fEmphasis}yyFlexLexer::LexerError(){f})
  614. if called.  See Generating C++ Scanners, below, for additional
  615. information.
  616.  
  617. A number of options are available for lint purists who
  618. want to suppress the appearance of unneeded routines in
  619. the generated scanner.  Each of the following, if unset,
  620. results in the corresponding routine not appearing in the
  621. generated scanner:
  622.  
  623. #Wrap off
  624. #fCode
  625. input, unput
  626. yy\_push\_state, yy\_pop\_state, yy\_top\_state
  627. yy\_scan\_buffer, yy\_scan\_bytes, yy\_scan\_string
  628. #f
  629. #Wrap on
  630.  
  631. (though {fEmphasis}yy\_push\_state(){f} and friends won't appear anyway
  632. unless you use {fEmphasis}%option stack{f}).
  633.  
  634.